var dialog = {
  visible: false,
  timer: null,
  img: '',
  back: false,
  init: function () {
    this.render();
  },
  render: function () {
    try {
      var url = page.data.bgs[3].typePicture[0].picPath3
      var html = '<div class="dialog" id="dialog" style="background-image: url(' + url + ')">'
      html += '<div class="dialog-body">'
      html += '<div class="dialog-container">'
      html += '</div>'
      html += '</div>'
      html += '</div>'
      $('body').append(html)
    } catch (error) {
      console.log('dialog render error')
    }
  },
  show: function(message, flag){
    $('.dialog .dialog-container').html(message)
    $('#dialog').css("display","block")
    this.visible = true
    this.back = flag ? true : false
  },
  hide: function(){
    $('.dialog .dialog-container').html('')
    $('#dialog').css("display","none")
    this.visible = false
    this.back = false
  }
}

